1. Field of the Invention
This invention relates to computer graphics systems, and more particularly to conversion of digital-video signals from YUV format to RGB format.
2. Description of the Related Art
Computer systems such as personal computers (PC's) display color images composed of picture elements or pixels. Each color pixel has a red, a green, and a blue component, often referred to as RGB. The RGB pixels are stored in a frame buffer before being scanned or rasterized to a display device such as a cathode-ray tube (CRT) or a flat-panel display. These RGB pixels are stored as digital values and then converted to analog voltages for CRT displays.
Higher-functionality graphics systems are becoming more common on personal computers. A video-capture port such as a zoom-video ZV port is often included. Television, video-camera, or photographic video signals can be input to a PC through such as video input port.
Television and photographic systems have used a different scheme to define colors. Instead of RGB encoding, color is defined using YUV encoding. Each color pixel in YUV encoding has a luminance component Y that represents overall brightness. The U and V components represent the color: U is the blue component that is scaled to the luminance Y, while V is the red color scaled to the luminance Y.
Since YUV encoding is entirely different from RGB encoding, video signals in the YUV format must be converted to the PC's RGB format. Once converted to the RGB color space, the video signals can be stored, manipulated and displayed on the PC.
Many prior-art color-space converters are known. See for example, U.S. Pat. Nos. 5,396,346 by Nakayama et al., 5,402,513 by Schafer, and 5,546,105 by Leak. These use a calculation-intensive approach that employs multipliers adders, and truncation or clipping.
Another approach is to use a lookup table. However, these lookup tables can be quite large. Some approaches use a combination of calculation with a lookup table. See for example, U.S. Pat. No. 5,124,668 by Rumball, and U.S. Pat. No. 5,510,852 by Shyu. Often an approximation rather than an exact conversion is used, such as shown by Rumball, where B is approximated as U+Y, rather than the more exact Y+1.732*U. These approximations are undesirable since they distort the colors of the captured images.
FIG. 1 is a conceptual diagram of a prior-art YUV-to-RGB converter using extensive calculation. The exact conversions are defined by the International Telecommunication Union, Radiocommunication Sector (ITU-R), an international standards committee in international standard ITU-R 601 (formerly CCIR-601).
The apparatus of FIG. 1 performs three calculations to convert the Y,U, and V video components to R, G, and B components. The red R component is defined as exactly Y +1.371*V. Multiplier 12 multiplies the constant 1.371 by the V component. The product from multiplier 12 is added to the Y component by adder 14. The sum from adder 14 is then clipped to a defined range by clipper 16 and then output as the red component R. Clipping is needed to keep the R component within a defined range, such as 0 to 255, when an underflow or overflow occurs during conversion, or when the YUV values are beyond the limits of the RGB color space.
The blue component B is defined as exactly Y+1.732*U. Multiplier 28 multiplies the constant 1.732 by the U component. The product from multiplier 28 is added to the Y component by adder 32. The sum from adder 32 is then clipped to a defined range by clipper 34 and output as the blue component B.
The green component G is defined as exactly Y-0.336*U-0.698*V. Multiplier 18 multiplies the constant -0.336 by the U component while multiplier 22 multiplies the constant -0.698 by the V component. The product from multiplier 18 is added to the Y component by adder 20. Adder 24 adds the sum from adder 20 to the product from multiplier 22. The sum from adder 24 is then clipped to a defined range by clipper 26 and then output as the green component G.
While the apparatus of FIG. 1 produces an exact result, many multiplies and additions are required. Four multiplies and Four additions are required. Either multiple adders and multipliers are required, or multiple steps through a single adder and multiplier are necessary. Overflow and underflow clippings are also required.
What is desired is an exact conversion from the YUV color space to the RGB color space. It is desired to not use an approximation. It is desired to reduce or eliminate the multiple adders and multipliers required for the prior-art converters. It is desired to use a relatively small look-up table without approximating the conversion.